package exception;

import java.io.FileOutputStream;

public class FinallyDemo2 {
    public static void main(String[] args) {
        FileOutputStream fos=null;
        try{
            fos=new FileOutputStream("a/abc.txt");
            fos.write(97);
        }catch (Exception e){
            System.out.println("写入出错");
        }finally {
            try {
                fos.close();
            }catch (Exception e){
                System.out.println("关闭资源出错");
            }
        }
    }
}
